package org.leaf.green.b2b

class Market {

    String serialNumber
    String name
    Region region
    MarketType marketType
    Boolean active

    static constraints = {
        serialNumber(nullable:false, blank:false, unique : true, maxSize : 6)
        name(nullable:false, blank : false, maxSize : 40)
        region(nullable:false)
        marketType(nullable:false)
        active(nullable:false)
    }

    String toString(){
        return "${serialNumber}-${name}"
    }

    static mapping = {
        table 'B2B_MARKET'
    }

}
